﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ItCool.Web.Models.ArticlePic>>" %>
 
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<link  type="text/css" rel="stylesheet" href="/css/userCenter.css"/>
<script type="text/javascript" src="/js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="/js/swfupload/handlers.js"></script>
<script type="text/javascript">
    var swfu;
    window.onload = function () {
        swfu = new SWFUpload({
            // Backend Settings
            upload_url: "/upload/index?articleid=<%=Request.Params["articleid"] %>",
            post_params: {
                "ASPSESSID": "<%=Session.SessionID %>"
            },

            // File Upload Settings
            file_size_limit: "2 MB",
            file_types: "*.jpg",
            file_types_description: "JPG 图片",
            file_upload_limit: "<%=ViewData["maxlimit"] %>",    // Zero means unlimited

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,

            // Button settings
            button_image_url: "/images/XPButtonNoText_160x22.png",
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 160,
            button_height: 22,
            button_text: '<span class="button">选择要上传的图片<span class="buttonSmall"></span></span>',
            button_text_style: '.button { text-align:center;font-family: Helvetica, Arial, sans-serif; font-size: 14px; } .buttonSmall { font-size: 12px; }',
            button_text_top_padding: 1,
            button_text_left_padding: 5,

            // Flash Settings
            flash_url: "/js/swfupload/flash/swfupload.swf", // Relative to this file

            custom_settings: {
                upload_target: "divFileProgressContainer"
            },

            // Debug Settings
            debug: false
        });
    }
	</script>
</asp:Content>
<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">
<div id="content">
     <%Html.RenderPartial("usercenter/menu");%>
        <div class="userMain">
      <h2 class="title">上传更多图片 
       </h2>    
     <p class="tips">
       你可以最多上传<%=ViewData["maxlimit"]%>张JPG格式图片,图片大小只能为2MB以下，每篇文章最多上传10张图片。
        <input type="button"  class="btn_login" value="返回" onclick="history.back();" />
     </p> 
    <% using (Html.BeginForm()) { %>
      
      <div id="swfu_container" style="margin: 10px 10px;">
      <div>
     
      </div>
		    <div>
				<span id="spanButtonPlaceholder"></span>
		    </div>
		    <div id="divFileProgressContainer" style="height: 75px;"></div>
		    <div id="thumbnails"></div>
	    </div>
        
    <% } %>
    </div>
    </div>
</asp:Content>
